import {DownloadTaskStatusOption} from "@/api/downloadTask/model";
import type {ISearchConfig} from "@/components/PageSearch/index.vue";

const searchConfig: ISearchConfig = {
    pageName: "user:downloadTask",
    formItems: [
        {
            type: "input",
            label: "任务编号",
            prop: "taskId",
            attrs: {
                placeholder: "任务编号",
                clearable: true,
                style: {
                    width: "200px",
                },
            },
        },
        {
            type: "select",
            label: "状态",
            prop: "taskStatusCode",
            attrs: {
                multiple: false,
                placeholder: "全部",
                clearable: true,
                style: {
                    width: "200px",
                },
            },
            async initFn(formItem) {
                formItem.options = DownloadTaskStatusOption
            },
        },
        {
            type: "date-picker",
            label: "创建时间",
            prop: "createAt",
            attrs: {
                type: "daterange",
                "range-separator": "~",
                "start-placeholder": "开始时间",
                "end-placeholder": "截止时间",
                "value-format": "YYYY-MM-DD",
                style: {
                    width: "240px",
                },
            },
        },
        {
            type: "input",
            label: "文件名",
            prop: "fileName",
            attrs: {
                placeholder: "文件名",
                clearable: true,
                style: {
                    width: "200px",
                },
            },
        }, {
            type: "input",
            label: "备注",
            prop: "remark",
            attrs: {
                placeholder: "备注",
                clearable: true,
                style: {
                    width: "200px",
                },
            },
        },
    ],
};

export default searchConfig;
